let areaContainerDiv = null
const bodyArr = document.getElementsByTagName('body')

if(bodyArr && bodyArr.length > 0){
  const body = bodyArr[0]
  areaContainerDiv = body.children['area-container-div']
  if(!areaContainerDiv){
    areaContainerDiv = document.createElement("div")
    areaContainerDiv.id = 'area-container-div'
    areaContainerDiv.className = 'area-container-div'
    body.appendChild(areaContainerDiv)
    createAreaMask()
  }
}

/** 创建遮罩 */
function createAreaMask(){
  const areaMask = document.createElement("div")
  areaMask.id="area-mask"
  areaMask.className = 'area-mask'
  areaMask.onclick = function(event){
    if(event.target !== this ) return
    areaContainerDiv.style.display = 'none'
  }
  if(areaContainerDiv) areaContainerDiv.appendChild(areaMask)
}








